import 'package:flutter/material.dart';
import '../Form.dart';

class CategoryPage extends StatefulWidget {
  CategoryPage({Key key}) : super(key: key);

  @override
  _CategoryPageState createState() => _CategoryPageState();
}

class _CategoryPageState extends State<CategoryPage> {
  @override
  Widget build(BuildContext context) {
    return Container(
       child: Column(
         crossAxisAlignment: CrossAxisAlignment.start,
         mainAxisAlignment: MainAxisAlignment.center,
         children: <Widget>[
           RaisedButton(
             child: Text("跳转到表单页面并传值"),
             onPressed: (){
                // 路由跳转
                // Navigator.of(context).push(
                //   MaterialPageRoute(
                //     builder: (context)=> FormPage(title: '我是跳转传值11',)
                //   )
                // );

                // Navigator.of(context).push(
                //   MaterialPageRoute(
                //     builder: (context){
                //       return FormPage();
                //     }
                //   )
                // );

                Navigator.pushNamed(context, '/form');
             },
             color: Theme.of(context).accentColor,
             textTheme: ButtonTextTheme.primary,
           )
         ],
       )
    );
  }
}